<?php
/**
 * Created by PhpStorm.
 * User: linvscode
 * Date: 2018/8/1
 * Time: 20:42
 */
namespace IMooc\Database;

use IMooc\IDatabase;

class MySQL implements IDatabase
{
    protected $conn;
    function connect($host, $user, $pwd, $dbname)
    {
        $conn = mysql_connect($host, $user, $pwd);
        mysql_select_db($dbname, $conn);
        $this->conn = $conn;
    }

    function query($sql)
    {
        // TODO: Implement query() method.
        return mysql_query($sql, $this->conn);
    }

    function close()
    {
        // TODO: Implement close() method.
        mysql_close($this->conn);
    }
}